package 多线程;

import org.junit.Test;

public class vmstat工具类测试 {

    @Test
    public void 制造高上下文切换场景查看cs值变化() throws InterruptedException {
        Thread thread1 = new Thread(()->{
            while(true){
                System.out.println("thread 1");
                Thread.yield();
            }
        });
        Thread thread2 = new Thread(()->{
            while(true){
                System.out.println("thread 2");
                Thread.yield();
            }
        });
        thread1.start();
        thread2.start();
        thread1.join();
        System.out.println("END");
    }
}
